package com.hunktimes.wholesale.net.model

import android.os.Parcel
import android.os.Parcelable

/**
 * Author: Delete
 * Date: 2020/7/28 18:27
 * Description:
 *
 */

data class AddressBundle(val name:String,val phone:String ,val address:String) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString()?:"",
        parcel.readString()?:"",
        parcel.readString()?:""
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(name)
        parcel.writeString(phone)
        parcel.writeString(address)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<AddressBundle> {
        override fun createFromParcel(parcel: Parcel): AddressBundle {
            return AddressBundle(parcel)
        }

        override fun newArray(size: Int): Array<AddressBundle?> {
            return arrayOfNulls(size)
        }
    }
}